//
// Decompiled by Jadx - 441ms
//
package gf;

import android.annotation.SuppressLint;
import android.os.Message;
import android.text.Html;
import android.text.TextUtils;
import android.widget.TextView;
import fi.w;
import fn.b;
import fn.j;
import fn.x;
import fn.y;
import fo.c;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import me.plusne.common.Json.WX.GameJson;
import o.a;
import org.luckypray.dexkit.query.matchers.ClassMatcher;
import org.luckypray.dexkit.query.matchers.FieldMatcher;
import org.luckypray.dexkit.query.matchers.MethodMatcher;
import org.luckypray.dexkit.result.FieldData;
import org.luckypray.dexkit.result.MethodData;
import r.g;

@a("WX")
public final class z extends x {

    @SuppressLint({"StaticFieldLeak"})
    public static TextView cp;
    public MethodData cq;
    public final ArrayList cr = new ArrayList();
    public w cs;

    public static boolean ct(z zVar, String str) {
        zVar.getClass();
        if (!TextUtils.isEmpty(str) && k.ct(str)) {
            y.co(Boolean.TRUE, "MessageNotifier");
            zVar.cr.add(str);
            new Timer().schedule((TimerTask) new aa(str), 100L);
            return true;
        }
        return false;
    }

    /* JADX WARN: Removed duplicated region for block: B:28:0x0073 A[Catch: IllegalArgumentException -> 0x00a9, TryCatch #0 {IllegalArgumentException -> 0x00a9, blocks: (B:26:0x0069, B:28:0x0073, B:31:0x0098, B:32:0x009c, B:34:0x008a, B:35:0x00a0), top: B:25:0x0069 }] */
    /* JADX WARN: Removed duplicated region for block: B:35:0x00a0 A[Catch: IllegalArgumentException -> 0x00a9, TRY_LEAVE, TryCatch #0 {IllegalArgumentException -> 0x00a9, blocks: (B:26:0x0069, B:28:0x0073, B:31:0x0098, B:32:0x009c, B:34:0x008a, B:35:0x00a0), top: B:25:0x0069 }] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static void cu(TextView textView) {
        boolean z;
        int i;
        CharSequence charSequence;
        if (textView == null) {
            TextView textView2 = cp;
            if (textView2 != null) {
                textView2.setTypeface(null, 0);
                TextView textView3 = cp;
                textView3.setText(textView3.getText().toString());
                return;
            }
            return;
        }
        String str = "";
        if (!y.ch("secretFriend_bold", false) && !y.ch("secretFriend_ITALIC", false) && TextUtils.isEmpty(b.g("secretFriend_color", ""))) {
            z = false;
        } else {
            z = true;
        }
        if (z && y.ch("MessageNotifier", false)) {
            try {
                if (y.ch("secretFriend_bold", false) && y.ch("secretFriend_ITALIC", false)) {
                    i = 3;
                } else {
                    if (y.ch("secretFriend_bold", false)) {
                        textView.setTypeface(null, 1);
                    } else if (y.ch("secretFriend_ITALIC", false)) {
                        i = 2;
                    }
                    if (TextUtils.isEmpty(b.g("secretFriend_color", ""))) {
                        String l = g.l(textView.getText().toString(), b.g("secretFriend_color", "").trim());
                        if (l != null) {
                            str = l.replace("\r\n", "<br />").replace("\n", "<br />");
                        }
                        charSequence = Html.fromHtml(str, 0);
                    } else {
                        charSequence = textView.getText().toString();
                    }
                    textView.setText(charSequence);
                }
                if (TextUtils.isEmpty(b.g("secretFriend_color", ""))) {
                }
                textView.setText(charSequence);
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            }
            textView.setTypeface(null, i);
        }
        cp = textView;
    }

    public final void a() {
        if (y.by.isLoadAllUserData()) {
            ArrayList arrayList = new ArrayList();
            arrayList.add(new GameJson("f790e342a02e0f99d34b316547f9aeab", "jsb_s.png", "石头"));
            arrayList.add(new GameJson("514914788fc461e7205bf0b6ba496c49", "jsb_j.png", "剪刀"));
            arrayList.add(new GameJson("091577322c40c05aa3dd701da29d6423", "jsb_b.png", "布"));
            ArrayList arrayList2 = new ArrayList();
            arrayList2.add(new GameJson("da1c289d4e363f3ce1ff36538903b92f", "dice_1.png", ""));
            arrayList2.add(new GameJson("9e3f303561566dc9342a3ea41e6552a6", "dice_2.png", ""));
            arrayList2.add(new GameJson("dbcc51db2765c1d0106290bae6326fc4", "dice_3.png", ""));
            arrayList2.add(new GameJson("9a21c57defc4974ab5b7c842e3232671", "dice_4.png", ""));
            arrayList2.add(new GameJson("3a8e16d650f7e66ba5516b2780512830", "dice_5.png", ""));
            arrayList2.add(new GameJson("5ba8e9694b853df10b9f2a77b312cc09", "dice_6.png", ""));
            MethodData t = c.t(MethodMatcher.create().usingStrings(new String[]{"NetSceneUploadEmoji: msgId = %s, md5 %s, len %s"}));
            this.cq = t;
            j.be(t, new a(this, arrayList2, arrayList));
            MethodData t2 = c.t(MethodMatcher.create().usingStrings(new String[]{"cannot pat, talker %s"}));
            this.cq = t2;
            j.be(t2, new b());
            MethodData t3 = c.t(MethodMatcher.create().paramCount(1).usingStrings(new String[]{"updateSettingTitle", "MicroMsg.LauncherUI.HomeUI"}));
            this.cq = t3;
            if (t3.getDeclaredClass() != null) {
                FieldData p = c.p(FieldMatcher.create().declaredClass(this.cq.getDeclaredClass().getName()).type("com.tencent.mm.ui.MMFragmentActivity"));
                FieldData p2 = c.p(FieldMatcher.create().declaredClass(this.cq.getDeclaredClass().getName()).type("com.tencent.mm.ui.MainTabUI"));
                j.bb(this.cq, new c(p, p2, c.p(FieldMatcher.create().declaredClass(p2.getType().getName()).type("int"))));
            }
            j.bd(c.n(ClassMatcher.create().usingStrings(new String[]{"WrapperHandler", "Do you want to quit this looper thread? You'd better get this Looper to quit."})).getName(), "sendMessageDelayed", new Object[]{Message.class, Long.TYPE, new d(this)});
            MethodData t4 = c.t(MethodMatcher.create().usingStrings(new String[]{"MicroMsg.MMNotification", "notifyOther newMsgList:%d :%s"}));
            this.cq = t4;
            j.bd(t4.getClassName(), this.cq.getMethodName(), new Object[]{List.class, new e(this)});
            j.bd("com.tencent.mm.ui.LauncherUIBottomTabView", "getMainTabUnread", new Object[]{new f(this)});
        }
    }
}
